Create Your First Doc
Now it is time to create your first doc and update your Gruntfile.js file to include in the compiling and rendering during the grunt "docular" task.
module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), docular: { groups: [ { groupTitle: 'My Test Docs', groupId: 'mytestdocs', groupIcon: 'icon-book', sections: [] } ], showDocularDocs: true, showAngularDocs: true } }); // Load the plugin that provides the "docular" tasks. grunt.loadNpmTasks('grunt-docular'); // Default task(s). grunt.registerTask('default', ['docular']); };
cd <your project root>
mkdir docs cd docs
touch test.doc
@doc overview @name Test Documentation Overview @description This is my test description! Notice it is multiline and supports the "Showdown" implementation of Markdown. You can add ## Sub headings You can also create numbered listes among other markdown items 1. Item one 2. Item two <pre> some command or script line </pre>
module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), docular: { groups: [ { groupTitle: 'My Test Docs', groupId: 'mytestdocs', groupIcon: 'icon-book', sections: [ { id: "overviewdocs", title:"My Overview Docs", scripts: [], docs: ['docs/'] } ] } ], showDocularDocs: true, showAngularDocs: true } }); // Load the plugin that provides the "docular" tasks. grunt.loadNpmTasks('grunt-docular'); // Default task(s). grunt.registerTask('default', ['docular']); };
cd <root of your project> mkdir scripts cd scripts touch test.js
/** * @doc module * @name firstmodule * @description This is the definition of the module. * It provides information about the module when the name of the * module is clicked */ /** * @doc function * @name firstmodule.class:myClass * @description This is a function that is classified as a "class" * within the module "firstmodule" with name myClass. * @param {string} stringInput A description of the stringInput for this function * @returns {number} Some number value description */ /** * Here I can still include inline comments for other developers * that are not included in the docs */ var myClass = function (stringInput) { return 1; };
module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), docular: { groups: [ { groupTitle: 'My Test Docs', groupId: 'mytestdocs', groupIcon: 'icon-book', sections: [ { id: "overviewdocs", title:"My Overview Docs", scripts: ['scripts/'], docs: ['docs/'] } ] } ], showDocularDocs: true, showAngularDocs: true } }); // Load the plugin that provides the "docular" tasks. grunt.loadNpmTasks('grunt-docular'); // Default task(s). grunt.registerTask('default', ['docular']); };
cd <your project root> grunt docular
grunt docular-server